//大标题筛选
var tagsType="";
document.querySelector(".subnav").onclick = function (event) {
    var ele = event.target;
    var eleUl = ele.parentElement.parentElement;
    var eleLiAll = eleUl.children;
    for (const eleLiAllElement of eleLiAll) {
        eleLiAllElement.firstElementChild.classList.remove("nav-a");
    }
    ele.classList.add("nav-a");

}

// 筛选框改变
var resultFilms="";
var filmType="";
var filmRegion="";
var filmYear="";
document.querySelector(".container").onclick = function (event){
    var ele = event.target;
    // console.log(ele.innerText);
    var eleUl= ele.parentElement.parentElement;
    var eleLiAll=eleUl.children;
    if(eleUl.nodeName=='UL') {
        for(var i=0;i<eleLiAll.length;i++){
            eleLiAll[i].classList.remove("li-one");
        }
        ele.parentElement.classList.add("li-one");
    }
    if(eleUl.previousElementSibling.innerText=="类型:"){
        if(ele.innerText!=null) {
            filmType = ele.innerText;
        }else
            filmType = '全部';
    }
    if(eleUl.previousElementSibling.innerText=="区域:"){
        filmRegion = ele.innerText;
    }
    if(eleUl.previousElementSibling.innerText=="年代:"){
        filmYear = ele.innerText;
    }
    resultFilms = "filmType="+filmType+"&filmRegion="+filmRegion+"&filmYear="+filmYear;
    console.log(resultFilms);
}
//切换页面效果
document.querySelector(".movie-page").onclick = function (event){
    var ele = event.target;
    console.log(ele);

}
